package de.java.hsrm.factory;

import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.plaf.synth.SynthContext;
import javax.swing.plaf.synth.SynthPainter;

public class GradientPainter extends SynthPainter{
	
	public void paintTextFieldBackground(SynthContext context, Graphics g, 
			int x, int y, int w, int h){
		Graphics2D g2 = (Graphics2D) g;
		
		GradientPaint p = new GradientPaint(x,y,new Color(0x555555),
				(x+w),10,new Color(0x333333));
		g2.setPaint(p);
		g2.fillRect(x, y, w, h/2);
		
		p = new GradientPaint(y,10,new Color(0x222222),
				(x+w),20,new Color(0x111111));
		g2.setPaint(p);
		g2.fillRect(x, h/2, w, h/2);
		g2.setPaint(null);
		
		
	}
	
}

